package org.mantenimientojsf.anotaciones ;

import java.io.Serializable;
import java.util.ResourceBundle;
/**
*
* @author avbravo
*/


public class Configuracion implements Serializable {

private static final long serialVersionUID = 1L;
private static String username;
private static String password;
private static String url;
private static String driver;
private static String database;
private static String driverClassName;
private static String proyecto;
private static String resourcename;
private static String tipo;
private static String type;
public static Exception excepcion;

public static String getDatabase() {
    return database;
}

public static void setDatabase(String database) {
     Configuracion.database = database;
 }

public static String getDriver() {
     return driver;
 }

public static void setDriver(String driver) {
     Configuracion.driver = driver;
  }

public static String getDriverClassName() {
     return driverClassName;
 }

public static void setDriverClassName(String driverClassName) {
    Configuracion.driverClassName = driverClassName;
}

public static String getPassword() {
     return password;
}

 public static void setPassword(String password) {
    Configuracion.password = password;
}

public static String getProyecto() {
    return proyecto;
 }

 public static void setProyecto(String proyecto) {
     Configuracion.proyecto = proyecto;
 }

public static String getResourcename() {
    return resourcename;
 }

public static void setResourcename(String resourcename) {
    Configuracion.resourcename = resourcename;
}

 public static String getTipo() {
      return tipo;
  }

  public static void setTipo(String tipo) {
      Configuracion.tipo = tipo;
   }

  public static String getType() {
      return type;
  }

  public static void setType(String type) {
       Configuracion.type = type;
   }

   public static String getUrl() {
       return url;
   }

    public static void setUrl(String url) {
        Configuracion.url = url;
    }

   public static String getUsername() {
       return username;
   }

    public static void setUsername(String username) {
       Configuracion.username = username;
   }

   public Configuracion() {
   }


   public boolean CargarArchivo(ResourceBundle rb) {
       try {
           excepcion = null;

           this.proyecto = rb.getString("proyecto");
           this.username = rb.getString("username");
           this.password = rb.getString("password");
           this.url = rb.getString("url");
           this.database = rb.getString("database");
           this.driverClassName = rb.getString("driverClassName");
           this.resourcename = rb.getString("Resourcename");
          this.tipo = rb.getString("tipo");
          this.type = rb.getString("type");
          return true;
      } catch (Exception e) {
          excepcion = e;
      }
      return false;
    }
}
